<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    929. Groups of Special-Equivalent Strings
   </h1>
   <p>
    You are given an array
    <code>
     A
    </code>
    of strings.
   </p>
   <p>
    Two strings
    <code>
     S
    </code>
    and
    <code>
     T
    </code>
    are&nbsp;
    <em>
     special-equivalent
    </em>
    &nbsp;if after any number of
    <em>
     moves
    </em>
    , S == T.
   </p>
   <p>
    A
    <em>
     move
    </em>
    consists of choosing two indices
    <code>
     i
    </code>
    and
    <code>
     j
    </code>
    with
    <code>
     i % 2 == j % 2
    </code>
    , and swapping
    <code>
     S[i]
    </code>
    with
    <code>
     S[j]
    </code>
    .
   </p>
   <p>
    Now, a
    <em>
     group of special-equivalent strings from
     <code>
      A
     </code>
    </em>
    &nbsp;is a&nbsp;non-empty subset S of
    <code>
     A
    </code>
    &nbsp;such that any string not in S&nbsp;is not special-equivalent with any string in S.
   </p>
   <p>
    Return the number of groups of special-equivalent strings from
    <code>
     A
    </code>
    .
   </p>
   <p>
    &nbsp;
   </p>
   <ul>
   </ul>
   <div>
    <p>
     <strong>
      Example 1:
     </strong>
    </p>
    <pre>
<strong>Input: </strong><span id="example-input-1-1">["a","b","c","a","c","c"]</span>
<strong>Output: </strong><span id="example-output-1">3</span>
<span><strong>Explanation</strong>: 3 groups ["a","a"], ["b"], ["c","c","c"]</span>
</pre>
    <div>
     <p>
      <strong>
       Example 2:
      </strong>
     </p>
     <pre>
<strong>Input: </strong><span id="example-input-2-1">["aa","bb","ab","ba"]</span>
<strong>Output: </strong><span id="example-output-2">4</span>
<strong>Explanation</strong>: 4 groups <span id="example-input-2-1">["aa"], ["bb"], ["ab"], ["ba"]</span>
</pre>
     <div>
      <p>
       <strong>
        Example 3:
       </strong>
      </p>
      <pre>
<strong>Input: </strong><span id="example-input-3-1">["abc","acb","bac","bca","cab","cba"]</span>
<strong>Output: </strong><span id="example-output-3">3</span>
<strong>Explanation</strong>: 3 groups ["abc","cba"], ["acb","bca"], ["bac","cab"]
</pre>
      <div>
       <p>
        <strong>
         Example 4:
        </strong>
       </p>
       <pre>
<strong>Input: </strong><span id="example-input-4-1">["abcd","cdab","adcb","cbad"]</span>
<strong>Output: </strong><span id="example-output-4">1</span>
<strong>Explanation</strong>: 1 group <span id="example-input-4-1">["abcd","cdab","adcb","cbad"]</span>
</pre>
       <p>
        &nbsp;
       </p>
       <p>
        <strong>
         Note:
        </strong>
       </p>
       <ul>
        <li>
         <code>
          1 &lt;= A.length &lt;= 1000
         </code>
        </li>
        <li>
         <code>
          1 &lt;= A[i].length &lt;= 20
         </code>
        </li>
        <li>
         All
         <code>
          A[i]
         </code>
         have the same length.
        </li>
        <li>
         All
         <code>
          A[i]
         </code>
         consist of only lowercase letters.
        </li>
       </ul>
      </div>
     </div>
    </div>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    929. 特殊等价字符串组
   </h1>
   <p>
    你将得到一个字符串数组
    <code>
     A
    </code>
    。
   </p>
   <p>
    如果经过任意次数的移动，S == T，那么两个字符串
    <code>
     S
    </code>
    和
    <code>
     T
    </code>
    是
    <em>
     特殊等价
    </em>
    的。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    一次
    <em>
     移动
    </em>
    包括选择两个索引
    <code>
     i
    </code>
    和
    <code>
     j
    </code>
    ，且&nbsp;
    <code>
     i％2 == j％2
    </code>
    ，并且交换
    <code>
     S[j]
    </code>
    和
    <code>
     S [i]
    </code>
    。
   </p>
   <p>
    现在规定，
    <em>
     <code>
      A
     </code>
     中的特殊等价字符串组
    </em>
    是
    <code>
     A
    </code>
    的非空子集
    <code>
     S
    </code>
    ，这样不在
    <code>
     S
    </code>
    中的任何字符串与
    <code>
     S
    </code>
    中的任何字符串都不是特殊等价的。
   </p>
   <p>
    &nbsp;
   </p>
   <p>
    返回
    <code>
     A
    </code>
    &nbsp;中特殊等价字符串组的数量。
   </p>
   <p>
    &nbsp;
   </p>
   <ul>
   </ul>
   <p>
    <strong>
     示例 1：
    </strong>
   </p>
   <pre><strong>输入：</strong>["a","b","c","a","c","c"]
<strong>输出：</strong>3
<strong>解释：</strong>3<strong> </strong>组 ["a","a"]，["b"]，["c","c","c"]
</pre>
   <p>
    <strong>
     示例 2：
    </strong>
   </p>
   <pre><strong>输入：</strong>["aa","bb","ab","ba"]
<strong>输出：</strong>4
<strong>解释：</strong>4 组 ["aa"]，["bb"]，["ab"]，["ba"]
</pre>
   <p>
    <strong>
     示例 3：
    </strong>
   </p>
   <pre><strong>输入：</strong>["abc","acb","bac","bca","cab","cba"]
<strong>输出：</strong>3
<strong>解释：</strong>3 组 ["abc","cba"]，["acb","bca"]，["bac","cab"]
</pre>
   <p>
    <strong>
     示例 4：
    </strong>
   </p>
   <pre><strong>输入：</strong>["abcd","cdab","adcb","cbad"]
<strong>输出：</strong>1
<strong>解释：</strong>1 组 ["abcd","cdab","adcb","cbad"]
</pre>
   <p>
    &nbsp;
   </p>
   <p>
    <strong>
     提示：
    </strong>
   </p>
   <ul>
    <li>
     <code>
      1 &lt;= A.length &lt;= 1000
     </code>
    </li>
    <li>
     <code>
      1 &lt;= A[i].length &lt;= 20
     </code>
    </li>
    <li>
     所有&nbsp;
     <code>
      A[i]
     </code>
     &nbsp;都具有相同的长度。
    </li>
    <li>
     所有&nbsp;
     <code>
      A[i]
     </code>
     &nbsp;都只由小写字母组成。
    </li>
   </ul>
  </div>
 </body>
</html>